package Day26;

import Day08.Variable;
import Day24.Manger;

import javax.accessibility.AccessibleStateSet;
import java.awt.event.TextEvent;
import java.time.format.TextStyle;

public class Text1 {
    public static void main(String[] args) {
        Worker w1 = new Worker("下周",3400);
        Manager m1 = new Manager("虾皇",34000,3400);
        System.out.println(w1.getAnnual());
        System.out.println(m1.getAnnual());
        System.out.println(showEmpAnnual(w1));
        System.out.println(showEmpAnnual(m1));
        testWork(w1);
        testWork(m1);

    }

    public static double  showEmpAnnual(Employee e){
       return e.getAnnual();
    }

    public static  void testWork(Employee e){
        if(e instanceof  Worker){
            Worker w1 = new Worker();
            w1 = (Worker)e;
            w1.work();
        }else if(e instanceof Manager){
            Manager m1 = new Manager();
            m1 = (Manager)e;
            m1.manage();
        }else{
            System.out.println("没有这个类型的");
        }
    }
}
